package kr.pe.johnkim.carrotpoint.mobile.service;

import kr.pe.johnkim.carrotpoint.mobile.dao.CarrotPointLogDao;
import kr.pe.johnkim.carrotpoint.mobile.domain.CarrotPointLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Carrot Point 로그 관련 service 클래스 이다.
 *
 * @author : John_Kim <cale9797@gmail.com>
 * @date : 13. 2. 6.
 */
@Service
public class CarrotPointLogServiceImpl implements CarrotPointLogService {

    // SLF4J Logging
    private Logger logger = LoggerFactory.getLogger(CarrotPointLogServiceImpl.class);

    @Autowired
    private CarrotPointLogDao carrotPointLogDao;

    /**
     * 로그를 등록 한다.
     *
     * @param carrotPointLog
     */
    @Override
    public void registerLog(CarrotPointLog carrotPointLog) {
        logger.info("registerLog");
        carrotPointLogDao.registerLog(carrotPointLog);
    }

    /**
     * 로그 목록을 가져 온다.
     *
     * @param carrotPointLog
     * @return
     */
    @Override
    public List<CarrotPointLog> getLogList(CarrotPointLog carrotPointLog) {
        logger.info("getLogList");
        return carrotPointLogDao.getLogList(carrotPointLog);
    }

    /**
     * 로그 내용을 가져 온다.
     *
     * @param carrotPointLog
     * @return
     */
    @Override
    public CarrotPointLog getLogInformation(CarrotPointLog carrotPointLog) {
        logger.info("getLogInformation");
        return carrotPointLogDao.getLogInformation(carrotPointLog);
    }
}
